home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2983 < prev    next >
Encoding:
Text File  |  1996-08-06  |  938 b   |  46 lines

  1. Path: dartvax.dartmouth.edu!NewsWatcher!user
  2. From: Robert.Lendvai@dartmouth.edu (Robert Lendvai)
  3. Newsgroups: comp.lang.c++
  4. Subject: Operator Overloading question
  5. Date: Sun, 21 Jan 1996 01:19:59 -1000
  6. Organization: Dartmouth College
  7. Message-ID: <Robert.Lendvai-2101960120380001@129.170.80.94>
  8. NNTP-Posting-Host: atgw-kip-1-94.dartmouth.edu
  9.  
  10. Codewarrior is saying this:
  11.  
  12. Error   : illegal 'operator' declaration
  13. player.h line 23   friend Boolean operator == (Player * member, char *
  14. dude); //Check to see if a player has this name
  15.  
  16. about the following code, but I have no idea why. Can anyone help?
  17.  
  18.  
  19.  
  20. #include <iostream.h>
  21. #include <stdlib.h>
  22.  
  23. class Player{
  24.  
  25. private:
  26.  
  27.  
  28. char * name;
  29. int rating;
  30. Player * next;
  31.  
  32. public:
  33.  
  34. Player(char * s);
  35. Player();
  36. ~Player();
  37.  
  38.  
  39.  
  40.  
  41. friend class Player_list;
  42. friend Boolean operator == (Player * member, char * dude); //Check to see
  43. if a                                             //player has this name
  44.  
  45. };
  46.